#ifndef _GRAPH_H_
#define _GRAPH_H_

#include <string>
#include <stdio.h>
#include <fstream>
#include <iostream>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

using namespace std;

// Struct to store a single point read in from the input files
struct Point
{
	float x, y;
};

// Contains a point and any other information your program needs
struct Vertex
{
	Point p;
};

// Connects two points, index1/2 refer to locations of vertices in an array
struct Edge
{
	int index1;
	int index2;
	float cost;
};

// The main class to be used by the program
class Graph
{
public:
	enum Algorithm { prim_heap, prim_unordered, kruskal_heapsort, kruskal_mergesort, kruskal_bubblesort };
	
	Graph();
	~Graph();

	void inputPoints(const std::string &filename);
	void calculateMST(Algorithm algorithm);
	void outputMST(const std::string &filename);
	
	int pointsSize;
	
private:
	
	Point *points;
	
	Edge *edges;
	int edgesSize;
	
	Edge *mst;
	
	void prims(Algorithm algorithm);
	void kruskals(Algorithm algorithm);
};

#endif /** _GRAPH_H_ **/